<template>
  <div>
    <input type="text" />
  </div>
</template>
<script setup lang="ts">
import { ref, computed } from "vue";
let firstName = ref("zhang");
let lastname = ref("san");
let name = computed<string>({
  get() {
    return firstName.value + "-" + lastname.value;
  },
  set(newVal) {
    [firstName.value, lastname.value] = newVal.split("-");
  }
});
const change = () => {
  name.value = "小-man";
}
</script>